Well-Typed Programs Can't Be Blamed
نویسندگان
چکیده
We introduce the blame calculus, which adds the notion of blame from Findler and Felleisen’s contracts to a system similar to Siek and Taha’s gradual types and Flanagan’s hybrid types. We characterise where positive and negative blame can arise by decomposing the usual notion of subtype into positive and negative subtyping, and show that these recombine to yield naive subtyping. Naive typing has previously appeared in type systems that are unsound, but we believe this is the first time naive subtyping has played a role in establishing type soundness.
منابع مشابه
A Declarative Semantics for Typed Logic Programs
Many typed (sorted) logic programming languages are based on sorted logics in which there is typically a set of well-sortedness rules in addition to the ordinary well-formedness rules. An advantage of this approach is that type checking is typically decidable. However such an approach restricts the expressiveness of typed logic programming language. On the other hand, there is another approach ...
متن کاملSafe Cross-Language Inheritance
Inheritance is a standard means for reuse and for interfacing with external libraries. In a multi-language software product, extending a class written in a statically-typed language with a dynamicallytyped class can require a significant number of manual indirections and other error-prone complications. Building on our previous interoperability work, we introduce a technique that allows safe, e...
متن کاملSelf-Interpretation and Reflection in a Statically Typed Language
Reflection is the ability of a system to perform a computation about itself. This ability typically includes a way of representing programs as data (“reification”) and of executing representations of programs (“selfinterpretation”). The interpreter is accessible to the interpreted program in the form of an “eval” function. Reflection is traditionally studied in untyped or dynamically typed lang...
متن کاملProbabilistic Noninterference in a Concurrent Language
In previous work [16], we give a type system that guarantees that well-typed multithreaded programs are possibilistically noninterfering. If thread scheduling is probabilistic, however, then well-typed programs may have probabilistic timing channels. We describe how they can be eliminated without making the type system more restrictive. We show that well-typed concurrent programs are probabilis...
متن کاملUsing Modes to Ensure Subject Reduction for Typed Logic Programs with Subtyping
We consider a general prescriptive type system with parametric polymorphism and subtyping for logic programs. The property of subject reduction expresses the consistency of the type system w.r.t. the execution model: if a program is"well-typed", then all derivations starting in a"well-typed"goal are again"well-typed". It is well-established that without subtyping, this property is readily obtai...
متن کامل